package com.leetcode.BinaryTree;

import java.util.ArrayList;
import java.util.List;

//中序遍历
public class lc_94 {
    public static void main(String[] args) {

    }

    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> res = new ArrayList<>();
        inorder(root,res);
        return res;
    }

    public void inorder(TreeNode root, List<Integer> res){
        if(root == null){
            return ;
        }
        inorder(root.left, res);
        res.add(root.val);
        inorder(root.right,res);
    }
}
